<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>BuzzApp</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
</head>
<body class="container">
    <div class="col-md-6 mx-auto">
        <div id="welcomeContent" class="d-none">
            <h1 id="welcomeMessage">Hello!</h1>
            <input name="name" type="text" class="form-control" placeholder="Your name here.." oninput="changeName()">
            <div class="text-center my-3">
                <button class="btn btn-primary" onclick="addUser()">Add User</button>
            </div>
            <div class="row my-2">
                <table class="table table-striped table-hover" id="userData">
        
                </table>
            </div>
        </div>
        <form class="needs-validation" name="registration-form">
            <h2 class="text-center text-success my-4">BuzzApp Registration</h2>
            <div class="form-group">
                <label for="fullName">Name</label>
                <input type="text" class="form-control" id="fullName" placeholder="Enter your name" pattern="[a-zA-Z ]+" max-length=20 min-length=5 required>
                <div class="invalid-feedback">
                    Please fill name.
                </div>
            </div>
            <div class="form-group">
                <label for="username">Username</label>
                <input type="text" class="form-control" id="username" placeholder="Username" pattern="[a-zA-Z]+" max-length=16 min-length=4 required>
                <div class="invalid-feedback">
                    Please fill username.
                </div>
            </div>
            <div class="form-group">
                <label for="exampleDOB1">DOB</label>
                <input type="date" class="form-control" id="dob" placeholder="YYYY-MM-DD" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}" onchange="validateAge()" required>
                <div class="invalid-feedback">
                    Please fill DOB.
                </div>
            </div>
            <div class="form-group">
                <label for="location">Country</label>
                <select id="location" class="custom-select" required>
                    <option value="">--Select One--</option>
                    <option value="India">India</option>
                    <option value="Australia">Australia</option>
                    <option value="US">US</option>
                    <option value="Russia">Russia</option>
                </select>
                <div class="invalid-feedback">
                    Please select location.
                </div>
            </div>
            <div class="form-group">
                <div class="form-check">
                    <input class="form-check-input" type="checkbox" id="terms" required>
                    <label class="form-check-label" for="terms">
                        I agree to terms and conditions
                    </label>
                    <div class="invalid-feedback">
                        You must agree for registering.
                    </div>
                </div>
            </div>
            <button class="btn btn-primary" onclick="submitForm(event)">Register</button>
        </form>
    </div>
    <script src="app.js"></script>
</body>
</html>